#!/bin/bash

#################################
#测试脚本
#################################

set -x

function check()
{
    wget https://gitee.com/spring_view/abseil-cpp/raw/openEuler-22.03-LTS-SP4/test_abseil.cpp
    g++ -std=c++17 -o test_abseil test_abseil.cpp -labsl_time -labsl_strings -labsl_base -labsl_synchronization
    ./test_abseil
    if [[ $? -eq 0 ]];then
        echo "RETURN SUCCESS"
    else
        echo "RETURN FAILED"
    fi
}

function main()
{
    ret=$(check)
    if [[ $ret == *'RETURN SUCCESS' ]];then
        echo "test scripts success"
    else
        echo "test scripts failed"
    fi
}
main

